﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.MarketUI {
    import flash.display.*;
    import org.aswing.*;
    import Classes.*;
    import Display.*;
    import flash.text.*;
    import Display.aswingui.*;

    public class ComingSoonPanel extends JPanel {

        protected var m_type:String;
        protected var m_bg:DisplayObject;

        public function ComingSoonPanel(_arg1:String){
            super(new SoftBoxLayout(SoftBoxLayout.X_AXIS, 5, SoftBoxLayout.CENTER));
            this.m_type = _arg1;
            this.makePanel();
        }
        protected function makePanel():void{
            var _local1:JPanel;
            var _local2:JPanel;
            this.m_bg = (new (Catalog.assetDict["comingSoonStars"])() as DisplayObject);
            ASwingHelper.setSizedBackground(this, this.m_bg, new Insets(0, 0, 0, 0));
            if (this.m_type == "wonders"){
                _local1 = this.makeItem(Catalog.assetDict["tower"]);
                _local2 = this.makeItem(Catalog.assetDict["coliseum"]);
            } else {
                if (this.m_type == "vehicles"){
                    _local1 = this.makeItem(Catalog.assetDict["tractor"]);
                    _local2 = this.makeItem(Catalog.assetDict["truck"]);
                };
            };
            var _local3:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            var _local4:JTextField = ASwingHelper.makeTextField(ZLoc.t("Dialogs", "ComingSoon"), EmbeddedArt.TITLE_FONT, 30, EmbeddedArt.yellowTextColor);
            _local4.filters = EmbeddedArt.titleFilters;
            TextFieldUtil.formatSmallCaps(_local4.getTextField(), new TextFormat(EmbeddedArt.TITLE_FONT, 42));
            _local3.appendAll(_local4);
            this.appendAll(_local1, _local2, ASwingHelper.horizontalStrut(90), _local3);
        }
        private function makeItem(_arg1:Class):JPanel{
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP);
            var _local3:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.LEFT);
            var _local4:DisplayObject = (new (Catalog.assetDict["comingSoonBg"])() as DisplayObject);
            ASwingHelper.setSizedBackground(_local2, _local4);
            var _local5:DisplayObject = (new (_arg1)() as DisplayObject);
            var _local6:AssetPane = new AssetPane(_local5);
            var _local7:Number = Math.max(0, (((_local4.width - _local5.width) / 2) + 1));
            var _local8:Number = Math.max(0, ((_local4.height - _local5.height) / 2));
            ASwingHelper.setEasyBorder(_local6, _local8, _local7);
            _local3.append(_local6);
            _local2.append(_local3);
            return (_local2);
        }

    }
}//package Display.MarketUI 
